<%@ page language="java" contentType="text/html; charset=UTF-8"
	pageEncoding="UTF-8"%>
<%@ page import="java.util.Map"%>
<%@ page import="java.util.List"%>
<%@ page import="java.util.Iterator"%>
<%@ page import="jt.classic.system.group.IGroup"%>
<%@ page import="jt.classic.system.user.IUser"%>
<%@ page import="jt.classic.app.info.AInfoDirectory"%>
<%@ page import="org.limp.mine.Label"%>
<%@ page import="org.limp.mine.Controller"%>
<%@ page import="org.limp.mine.DateTrimmer"%>
<%
	String context = jt.classic.system.ISystem.getContextPath();
	Object[] result = (Object[]) request.getAttribute("result");
	Label label = (Label) result[1];
	Controller controller = (Controller) result[2];
	String pageNO = (String) result[3];
	List resultList = (List) result[0];

	String qname = (String) request.getAttribute("qname");
%>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<title>幻灯片信息列表</title>
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
</head>
<jsp:include page="../head.jsp"></jsp:include>
<script language="javascript">
  var chk = false;
  function checkall(thizz){
    var chks = document.getElementsByTagName("input");
    for(var i=0;i<chks.length;i++){
      if(chks[i].type == "checkbox"){
        chks[i].checked = !chk;
      }
    }
    
    chk = !chk;
  }
  
  function handleDelete(){
    var rnt = false;
    var ids = "";
    var chks = document.getElementsByTagName("input");
    for(var i=0;i<chks.length;i++){
      if(chks[i].type == "checkbox" && chks[i].checked){
        rnt = true;
        ids += chks[i].value + ",";
      }
    }
    
    if(!rnt){
      alert("请选择要删除幻灯片");
    }else if(confirm("删除幻灯片")){
      createHidden("ids",ids.substring(0,ids.length - 1));
      document.form1.action = "<%=context%>/app/info.do?method=delslide";
      document.form1.submit();
    }
  }
  
  function handleQuery(){
      document.form1.action = context + "/app/info.do?method=slidelistinfo";
      document.form1.submit();
  }
  
  function handleView(id,name){
      var url = context + "/app/info.do?method=previewinfo&id=" + id; 
      top.xwin(this,url,false,name);
  }
  
  function handleInsert(){
      window.location.href =  context + "/app/info.do?method=neuslideinfo"; 
  }
  
  function handleEdit(id){
      window.location.href = context + "/app/info.do?method=slideinfo&id=" + id; 
  }
 
  function handleSelect(s){
      var url = context + "/app/info.do?method=directorytree&select=true";
      dialog(url,true,"选择所属栏目",300,350);
  }
  
  function responseResult(ids,names,types){
      document.form1.qdirec.value = names;
      
      closeDialog();
  }
</script>
<body>
<form name="form1" method="post" action=""><input type="hidden"
	name="pageNO" value="<%=pageNO%>">	
<div style="margin-left:15px;">
<img src="<%=context %>/app/info/images/addinfo.png" title="新建图片新闻" style="cursor:hand;margin-bottom:-4px;" onclick="javascript:handleInsert();"/>新建
<img src="<%=context %>/app/info/images/page_white_delete.png" title="删除图片新闻" style="cursor:hand;margin-bottom:-4px;" onclick="javascript:handleDelete();"/>删除
</div>
<table class="tbl" align="center" width="98%">
    <thead>
	<tr>
		<td class="td1"
			title="全部选择/取消选择" onclick="javascript:checkall();" width="10"
			align="center">&nbsp;</td>
		<td class="td1"
			width="25%" align="center">&nbsp;<b>幻灯片新闻名称</b></td>
		<td class="td1"
			width="15%" align="center">&nbsp;<b>key</b></td>
		<td class="td1"
			width="10%" align="center">&nbsp;<b>幻灯方式</b></td>
		<td class="td1"
			width="15%" align="center">&nbsp;<b>制作人</b></td>
		<td class="td1"
			width="25%" align="center">&nbsp;<b>制作时间</b></td>
	</tr>
	</thead>
	<tbody>
	<%
			if (resultList != null && !resultList.isEmpty()) {
			for (int i = 0; i < resultList.size(); i++) {
				Map info = (Map) resultList.get(i);
				String number = (String) info.get("PAGINATION_NUMBER");
				String title = (String) info.get("ASNAME");
				String key = (String) info.get("ASKEY");
				String stype = (String) info.get("SLIDETYPE");
				String date = (String) info.get("CREATETIME");
				String username = (String) info.get("USER_NAME");
				String id = (String) info.get("AS_ID");
	%>
	<tr onMouseOver="javascript:this.bgColor='#ffff99'"
		onmouseout=" javascript:this.bgColor='#ffffff'" bgColor="#ffffff">
		<td align="center"><input type="checkbox" name="chk"
			value="<%=id%>"><!--<%=number%>--></td>
		<td align="center">&nbsp;<a
			href="<%=context%>/app/info.do?method=editslideinfo&id=<%=id%>"><%=title%></a></td>
		<td align="center">&nbsp;<%=key%></td>
		<td align="center">&nbsp;<%=stype%></td>
		<td align="center">&nbsp;<%=username%></td>
		<td align="center">&nbsp;<%=DateTrimmer.getYMDHMS_LBL(date)%></td>
	</tr>
	<%
		}
		}
	%>
	</tbody>
</table>
<div id="pager"><div style="float:left;padding:5px;"><%=label.displayLabel()%>
					</div> <div style="float:right;padding:5px;"><%=label.startLabel()%> <%=label.previousLabel()%>
						<%=label.nextLabel()%> <%=label.endLabel()%> 
				<%=controller.getController().toString()%></div>
				</div>
				<%=controller.getControlScript(true)%>
</form>
</body>
</html>
